package com.five.wechat.serviceImp;

import com.five.common.been.ReturnTextEntity;
import com.five.common.been.enumbeen.NotFonudMsgBack;
import com.five.common.util.BaseUtil;
import com.five.common.util.XmlUtil;
import com.five.wechat.service.OtherService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @ClassName OtherServiceImp
 * @Author wuxuan
 * @Date 2019/1/19 16:30
 * @Version 1.0
 * @Description
 **/
@Service("otherServiceType")
@Slf4j
public class OtherServiceImp implements OtherService {
    @Override
    public String handleOtherCase(Map<String, String> xml) {
        log.info("没有匹配到对应的微信消息类型");
        //获取整形的时间
        String newTime = BaseUtil.getBaseUtil().getIntegerTime();
        String ToUserName = xml.get("ToUserName");
        String FromUserName = xml.get("FromUserName");
        ReturnTextEntity Tentity = new ReturnTextEntity();
        Tentity.setToUserName(FromUserName);
        Tentity.setFromUserName(ToUserName);
        Tentity.setCreatetime(newTime);
        Tentity.setMsgType("text");
        Tentity.setContent(NotFonudMsgBack.getMsg(4));
        return XmlUtil.getXmlUtil().ReturnMsg(Tentity);
    }
}
